package com.hopuIT.test;

import java.io.IOException;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import com.hopuIT.model.Users;

public class Demo01 {
	public static void main(String[] args) throws IOException {
		selectOne();
	}

	private static void selectOne() throws IOException{
		SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("mybatis-config.xml"));
		SqlSession session = factory.openSession();
		Users userInfo = session.selectOne("com.hopuIT.mapper.UsersMapper.getUsersById",2);
		System.out.println(userInfo);
		session.close();
	}
}
